import { HashRouter as Router,Redirect, Route, Switch } from 'react-router-dom'
import React, { Suspense} from "react"
import {Spin} from 'antd'
import PrivateRoute from 'components/PrivateRoute/index'
const WordLibrary = React.lazy(() => import('pages/word/index'));
const WordInfo = React.lazy(() => import('pages/word/info'));
const AudioLibrary = React.lazy(() => import('pages/audio/index'));
const AudioInfo = React.lazy(() => import('pages/audio/info'));
const videoLibrary = React.lazy(() => import('pages/video/index'));
const VideoInfo = React.lazy(() => import('pages/video/info'));
const videoAlbumLibrary = React.lazy(() => import('pages/video/videoAlbumLibrary'));
const videoAlbumInfo = React.lazy(() => import('pages/video/videoAlbumInfo'));
const studyInfo = React.lazy(() => import('pages/video/studyInfo'));
const studyVideoLibrary = React.lazy(() => import('pages/video/studyVideoLibrary'));
const bookInfo = React.lazy(() => import('pages/book/info'));
const bookLibrary = React.lazy(() => import('pages/book/index'));
const intensiveBook = React.lazy(() => import('pages/book/intensiveBook'));
const intensiveBookInfo = React.lazy(() => import('pages/book/intensiveBookInfo'));
const bookAdd = React.lazy(() => import('pages/book/indexAdd'));
const TestPaperLibrary = React.lazy(() => import('pages/paper/index'));
const TestPaperInfo = React.lazy(() => import('pages/paper/info'));
const SubjectLibrary = React.lazy(() => import('pages/paper/subject'));
const GraphLibrary = React.lazy(() => import('pages/game/index'));
const CourseSubject = React.lazy(() => import('pages/theme/index'));
const UserTheme = React.lazy(() => import('pages/theme/userTheme'));
const UserThemeInfo = React.lazy(() => import('pages/theme/userThemeInfo'));
const ThemeSubjectInfo = React.lazy(() => import('pages/theme/info'));
const Task = React.lazy(() => import('pages/task/index'));
const PlanLibrary = React.lazy(() => import('pages/plan/index'));
const PlanSubject = React.lazy(() => import('pages/plan/info'));
const BookPool = React.lazy(() => import('pages/pool/bookPool'));
const AudioPool = React.lazy(() => import('pages/pool/audioPool'));
const VideoPool = React.lazy(() => import('pages/pool/video'));
const PoolRule = React.lazy(() => import('pages/pool/poolRule'));
const Area = React.lazy(() => import('pages/pool/area'));
const AreaRule = React.lazy(() => import('pages/pool/areaRule'));
const Test = React.lazy(() => import('pages/pool/test'));
const Label = React.lazy(() => import('pages/advanced/label'));
const Dictionaries = React.lazy(() => import('pages/advanced/dictionaries'));
const GradingResults = React.lazy(() => import('pages/advanced/gradingResults'));
const LevelExplain = React.lazy(() => import('pages/advanced/levelExplain'));
const MappingLevel = React.lazy(() => import('pages/advanced/mappingLevel'));
const ReadRule = React.lazy(() => import('pages/advanced/readRule'));
const ruleManagement = React.lazy(() => import('pages/account/index'));
const roleManagement = React.lazy(() => import('pages/account/role'));
const employeesManagement = React.lazy(() => import('pages/account/rule'));
const editAppLevel = React.lazy(() => import('pages/account/cApp'));
const Error = () => import('pages/error/404')

function ContentItem(){

  // 主题内容区域
  return   <Router>
   <Suspense fallback={ <div className="loading-mask">
     正在加载中...<Spin size="large" />
    </div>}>
     <Switch>
     <Route path={`/view`} exact render={() => <Redirect to={`/view/word/wordLibrary`}/>}/>
     <PrivateRoute exact path="/view/word/wordLibrary" component={WordLibrary}/>
     <PrivateRoute exact path="/view/word/wordInfo" component={WordInfo}/>
     <PrivateRoute exact path="/view/audio/audioLibrary" component={AudioLibrary}/>
     <PrivateRoute exact path="/view/audio/audioInfo" component={AudioInfo}/>
     <PrivateRoute exact path="/view/video/videoLibrary" component={videoLibrary}/>
     <PrivateRoute exact path="/view/video/videoInfo" component={VideoInfo}/>
     <PrivateRoute exact path="/view/video/videoAlbumLibrary" component={videoAlbumLibrary}/>
     <PrivateRoute exact path="/view/video/videoAlbumInfo" component={videoAlbumInfo}/>
     <PrivateRoute exact path="/view/video/studyVideoLibrary" component={studyVideoLibrary}/>
     <PrivateRoute exact path="/view/video/studyInfo" component={studyInfo}/>
     <PrivateRoute exact path="/view/book/bookInfo" component={bookInfo}/>
     <PrivateRoute exact path="/view/book/bookLibrary" component={bookLibrary}/>
     <PrivateRoute exact path="/view/book/intensiveBook" component={intensiveBook}/>
     <PrivateRoute exact path="/view/book/intensiveBookInfo" component={intensiveBookInfo}/>
     <PrivateRoute exact path="/view/book/bookAdd" component={bookAdd}/>
     <PrivateRoute exact path="/view/test/testPaperLibrary" component={TestPaperLibrary}/>
     <PrivateRoute exact path="/view/test/testPaperInfo" component={TestPaperInfo}/>
     <PrivateRoute exact path="/view/test/subjectLibrary" component={SubjectLibrary}/>
     <PrivateRoute exact path="/view/graph/graphLibrary" component={GraphLibrary}/>
     <PrivateRoute exact path="/view/plan/courseSubject" component={CourseSubject}/>
     <PrivateRoute exact path="/view/plan/themeSubjectInfo" component={ThemeSubjectInfo}/>
     <PrivateRoute exact path="/view/plan/userCounrseSubject" component={UserTheme}/>
     <PrivateRoute exact path="/view/plan/userCounrseSubjectList" component={UserThemeInfo}/>
     <PrivateRoute exact path="/view/ordinary/task" component={Task}/>
     <PrivateRoute exact path="/view/plan/planLibrary" component={PlanLibrary}/>
     <PrivateRoute exact path="/view/plan/planSubject" component={PlanSubject}/>
     <PrivateRoute exact path="/view/areaPush/areaPushBookLibrary" component={BookPool}/>
     <PrivateRoute exact path="/view/areaPush/areaPushAudioLibrary" component={AudioPool}/>
     <PrivateRoute exact path="/view/areaPush/areaPushVideoLibrary" component={VideoPool}/>
     <PrivateRoute exact path="/view/areaPush/areaPushRule" component={PoolRule}/>
     <PrivateRoute exact path="/view/areaPush/explorePool" component={Area}/>
     <PrivateRoute exact path="/view/areaPush/explorePoolRule" component={AreaRule}/>
     <PrivateRoute exact path="/view/areaPush/testPool" component={Test}/>
     <PrivateRoute exact path="/view/task/dictionaries" component={Label}/>
     <PrivateRoute exact path="/view/task/label" component={Dictionaries}/>
     <PrivateRoute exact path="/view/task/gradingResults" component={GradingResults}/>
     <PrivateRoute exact path="/view/task/levelExplain" component={LevelExplain}/>
     <PrivateRoute exact path="/view/task/mappingLevel" component={MappingLevel}/>
     <PrivateRoute exact path="/view/task/readRule" component={ReadRule}/>
     <PrivateRoute exact path="/view/super/employeesManagement" component={employeesManagement}/>
     <PrivateRoute exact path="/view/super/roleManagement" component={roleManagement}/>
     <PrivateRoute exact path="/view/super/ruleManagement" component={ruleManagement}/>
     <PrivateRoute exact path="/view/super/editAppLevel" component={editAppLevel}/>
      <Route path='*' component={Error}/>
     </Switch>
   </Suspense>
   </Router>
}

export default ContentItem